<%--
  Created by IntelliJ IDEA.
  User: 10352
  Date: 2022/8/10
  Time: 19:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table border="1">
    <h1>学校机房管理系统</h1>
    <a href="add.jsp">添加机房 </a>
    <tr>
        <td>序号</td>
        <td>机房名称</td>
        <td>计算机数量</td>
        <td>机房管理员</td>
        <td>机房位置</td>
        <td>机房状态</td>
        <td>操作</td>
    </tr>
    <c:forEach var="q" items="${show}">
        <tr>
            <td>${q.id}</td>
            <td>${q.name}</td>
            <td>${q.number}</td>
            <td>${q.manager}</td>
            <td>${q.location}</td>
            <c:if test="${q.state==1}">
            <td>使用</td>
            </c:if>
            <c:if test="${q.state==2}">
                <td>维护</td>
            </c:if>
            <c:if test="${q.state==3}">
                <td>空闲</td>
            </c:if>
            <td><a onclick="e(${q.id})">删除</a></td>
        </tr>
    </c:forEach>
    <script>


        function e(e) {
            var r = confirm("您确定要删除吗？")
            if (r == true) {
                location.href="DeleteServlet?id=" + e
            } else {
                return;
            }
        }
    </script>
</table>
</body>
</html>
